package com.dks.constant;

/**
 * 微信支付 常量
 * @author evan
 * @date 2019/9/27
 */
public class WXConstantValue {

    //货币类型
    public static final String CURRENCY_TYPE_CNY = "CNY"; //人民币

    //微信支付 公共参数
    public static final String WXPAY_COMMON_PARAM_NONCE_STR = "nonce_str";
    public static final String WXPAY_COMMON_PARAM_RETURN_CODE = "return_code";
    public static final String WXPAY_COMMON_PARAM_RETURN_MSG = "return_msg";
    public static final String WXPAY_COMMON_PARAM_RESULT_CODE = "result_code";
    public static final String WXPAY_COMMON_PARAM_ERR_CODE = "err_code";
    public static final String WXPAY_COMMON_PARAM_ERR_CODE_DES = "err_code_des";


    //统一下单 请求参数
    public static final String REQ_PARAM_UNIFIED_ORDER_DEVICE_INFO = "device_info";
    public static final String REQ_PARAM_UNIFIED_ORDER_BODY = "body";
    public static final String REQ_PARAM_UNIFIED_ORDER_OUT_TRADE_NO = "out_trade_no";
    public static final String REQ_PARAM_UNIFIED_ORDER_FEE_TYPE = "fee_type";
    public static final String REQ_PARAM_UNIFIED_ORDER_TOTAL_FEE = "total_fee";
    public static final String REQ_PARAM_UNIFIED_ORDER_SPBILL_CREATE_IP = "spbill_create_ip";
    public static final String REQ_PARAM_UNIFIED_ORDER_NOTIFY_URL = "notify_url";
    public static final String REQ_PARAM_UNIFIED_ORDER_TRADE_TYPE = "trade_type";
    public static final String REQ_PARAM_UNIFIED_ORDER_TIME_START = "time_start";
    public static final String REQ_PARAM_UNIFIED_ORDER_TIME_EXPIRE = "time_expire";
    public static final String REQ_PARAM_UNIFIED_ORDER_OPEN_ID = "openid";
    //返回结果
    public static final String RESP_PARAM_UNIFIED_ORDER_APPID = "appid";
    public static final String RESP_PARAM_UNIFIED_ORDER_MCH_ID = "mch_id";
    public static final String RESP_PARAM_UNIFIED_ORDER_PREPAY_ID = "prepay_id";


    //调起支付接口 请求参数
    public static final String REQ_PARAM_PAYMENT_CALL_APPID = "appid";
    public static final String REQ_PARAM_PAYMENT_CALL_PARTNERID = "partnerid";
    public static final String REQ_PARAM_PAYMENT_CALL_PREPAYID = "prepayid";
    public static final String REQ_PARAM_PAYMENT_CALL_PACKAGE = "package";
    public static final String REQ_PARAM_PAYMENT_CALL_NONCESTR = "noncestr";
    public static final String REQ_PARAM_PAYMENT_CALL_TIMESTAMP = "timestamp";
    public static final String REQ_PARAM_PAYMENT_CALL_SIGN = "sign";
    //字段默认值
    public static final String REQ_PARAM_PAYMENT_CALL_PACKAGE_VALUE = "Sign=WXPay"; //扩展字段


    //支付类型
    public enum WXPayTradeType{
        APP("APP"), /** APP支付 */
        MICROPAY("MICROPAY"), /** 付款码支付 */
        JSAPI("JSAPI"), /** JSAPI支付 */
        NATIVE("NATIVE"), /** Native支付*/
        H5("MWEB"); /** H5支付 */

        private String type;

        public String getType() {
            return type;
        }

        WXPayTradeType(String type) {
            this.type = type;
        }
    }

    //支付结果状态
    public enum WXPayResult{
        SUCCESS("SUCCESS"),
        FAIL("FAIL");

        private String value;

        WXPayResult(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }

}
